<?php

function is_logged() {
  // FIXME: do connection checking: ip, random number...
  return isset($_SESSION['logged']) && $_SESSION['logged'];
}

function login() {
  if(!(isset($_POST['name'])&&isset($_POST['passwd']))) return false;
  $_SESSION['logged']=true;
  $_SESSION['username']=$_POST['name'];
  return true;
}

?>
